unit spr_Zkxs;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, shbl_Directory, FIBDatabase, pFIBDatabase, ExtCtrls, 
  DB, FIBDataSet, pFIBDataSet, ActnList, Buttons, GridsEh, DBGridEh,
  StdCtrls, ComCtrls, ToolWin, DBCtrlsEh, DBLookupEh, Mask, PropFilerEh,
  PropStorageEh, XLSExportComp, DBGridEhGrouping;

type
  TsprZkxs = class(TshblDirectory)
    dsReferID: TFIBIntegerField;
    dsReferNAME: TFIBStringField;
    dsReferADDRESS: TFIBStringField;
    dsReferPHONE: TFIBStringField;
    dsReferDESCRIPTION: TFIBStringField;
    dsReferMUNIC: TFIBSmallIntField;
    dsReferCODE: TFIBStringField;
    dsReferORGCODE: TFIBIntegerField;
    dsReferRCOMFORT: TFIBBCDField;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    Label5: TLabel;
    Label6: TLabel;
    Label8: TLabel;
    DBEditEh1: TDBEditEh;
    DBEditEh4: TDBEditEh;
    DBEditEh5: TDBEditEh;
    DBEditEh6: TDBEditEh;
    DBEditEh2: TDBEditEh;
    DBEditEh3: TDBEditEh;
    DBLookupComboboxEh1: TDBLookupComboboxEh;
    dbcbSupplier: TDBCheckBoxEh;
    DBEditEh7: TDBEditEh;
    Label7: TLabel;
    dsOrgs: TpFIBDataSet;
    dsOrgsID: TFIBIntegerField;
    dsOrgsNAME: TFIBStringField;
    dscOrgs: TDataSource;
    procedure dsReferBeforeEdit(DataSet: TDataSet);
    procedure dsReferBeforeInsert(DataSet: TDataSet);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  sprZkxs: TsprZkxs;

implementation

{$R *.dfm}

procedure TsprZkxs.dsReferBeforeEdit(DataSet: TDataSet);
begin
  inherited;
  if dsOrgs.Active = false then dsOrgs.Open;
end;

procedure TsprZkxs.dsReferBeforeInsert(DataSet: TDataSet);
begin
  inherited;
  if dsOrgs.Active = false then dsOrgs.Open;
end;

end.
